import { request } from "@/utils/http";
import type {
  getHosSetListPramsTypes,
  getHosSetListReqReturn,
  postAddHosPramsType,
  getHosSetListItem,
  putHosPramsType,
  key
} from "./model/hospitalSetTypes"
export const getHospitalSetListRequest = ({page,limit,hosname,hoscode}:getHosSetListPramsTypes) =>{
  return request.get<any,getHosSetListReqReturn>(`admin/hosp/hospitalSet/${page}/${limit}`,{
    params:{
      hosname,
      hoscode
    }
  })
}

//2.添加医院的api请求

export const postAddHosRequest = (data:postAddHosPramsType) => {
  return request.post<any,null>('/admin/hosp/hospitalSet/save',data)
}

//3.根据id获取医院信息
export const getHosMsgFromIdReq = (id:string) =>{
  return request.get<any,getHosSetListItem>(`/admin/hosp/hospitalSet/get/${id}`)
}

//4.设置修改医院信息的请求
export const putHosMsgRequest = (data:putHosPramsType) =>{
  return request.put<any,null>(`/admin/hosp/hospitalSet/update`,data)
}

//5.删除医院信息请求
export const deleteHosRequest = (id:number) => {
  return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}

//6.批量删除请求
export const batchDeleteRequest = (ids:key[]) => {
  return request.delete<any,null>('/admin/hosp/hospitalSet/batchRemove',{
    data:ids
  })
}